package com.xinqi.modules.course.content.controller.app;

import com.xinqi.common.base.response.R;
import com.xinqi.common.satoken.utils.LoginHelper;
import com.xinqi.modules.course.clazz.dto.rsp.ClassAllResultDTO;
import com.xinqi.modules.course.clazz.service.ClassService;
import com.xinqi.modules.stats.assistant.dto.req.RemindCheckDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * APP -- 新奇提醒数据查看校验
 *
 * @author: yyzhen
 * @date: 2023/05/15
 */
@Validated
@RestController
@RequestMapping("/app/remind")
@RequiredArgsConstructor
public class RemindAppController {

    private final ClassService classService;


    /**
     * 判断新奇提醒消息是否可以查看详情
     *
     * @param dto
     * @return
     */
    @PostMapping("/check")
    public R<ClassAllResultDTO> remindCheck(@Validated @RequestBody RemindCheckDTO dto) {
        dto.setOperationUserId(LoginHelper.getUserId());
        return R.data(classService.classAllMessage(dto));
    }

}
